/*******************************************************************************
 * This file is part of blueprint4j www.blueprint4j.org.
 * 
 *     blueprint4j is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 * 
 *     blueprint4j is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 * 
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with blueprint4j. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
/**
* This is an abstract message class no fields have been defined in this
* class
* $Log: ISO8583.java,v $
* Revision 1.1.1.1  2004/04/22 12:56:14  travisb
* Fir
*
* Revision 1.1.1.1  2003/12/21 09:04:08  jaspervdb
* no message
*
* Revision 1.1.1.1  2003/10/20 15:30:48  travisb
* First import into CVS at Cellstop
*
* Revision 1.1.1.1  2003/03/30 15:25:28  tbulford
* no message
*
* Revision 1.1  2003/01/12 08:30:34  travis
* Import x MANY
*
* Revision 1.1.1.1  2002/12/16 22:14:01  jasper
* no message
*
* Revision 1.1  2002/02/20 13:30:43  JasperV
* First time add to new Applications layer
*
* Revision 1.1  2002/01/24 14:18:14  travisb
* First Version of the Application Layer
*
* Revision 1.1  2002/01/21 08:06:07  travisb
* First version commited to CVS
*
*/

package blueprint4j.messages;

public class ISO8583 {

	public static String getFieldName(int num)
	throws ExceptionMessage {
		if (num < 0 || num > 128) {
			throw new ExceptionMessage("Field name requested [" + num + "] out of range must be from 0-128");
		}
		return field_names[num*2];
	}

	public static String getFieldDescription(int num)
	throws ExceptionMessage {
		if (num < 0 || num > 128) {
			throw new ExceptionMessage("Field Description requested [" + num + "] out of range must be from 0-128");
		}
		return field_names[num*2 + 1];
	}

	static private String[] field_names = new String[] {
				"Bit Map", "Primary bit map indicating the presence or absence of bits in range 2-64 in the message being transmitted.",
				"Bit Map Extended", "Secondary bit map indicating the presence or absence of bits in range 65-128 in the message being transmitted.",
				"Primary account number (PAN)", "Customer PAN, used to route messages.",
				"Precessing code", "Define the transaction type 3x2 digit fields. 1&2=type of trans, 3&4=type of account, 5&6=to account (zeroes)",
				"Amount, transaction", "Transaction amount in (lowest unit local currency) at the acquirer.",
				"Amount, Settlement", "",
				"Amount, cardholder billing", "Amount in (lowest unit local currency) of amount to be debited from the account held by the issuer.",
				"Transmission date & time", "Message transmission date and time in GMT. Switch completes this field.",
				"Amount, Cardholder billing fee", "",
				"Conversion rate, Settlement", "",
				"Conversion rate, cardholder billing", "Conversion rate applied to forex txn amount. format ABBBBBBB where A is the decimal point position from the right and B is the conversion factor which when multiplied by field 4 gives field 6.",
				"Systems trace audit number", "Sequence number assigned by message originator. Stays Unchanged through txn life.",
				"Time, Local transaction", "Time of the local transaction",
				"Date, Local transaction", "Date of the local transaction",
				"Date, Expiration", "Card expiration date",
				"Date, Settlement", "Date of settlement",
				"Date, conversion", "",
				"Date, capture", "",
				"Merchant type", "Category code of merchant acquirer. Auth transactions only.",
				"Acquiring institution country code", "Country code of acquiring institution",
				"PAN Extended, country code", "",
				"Forwarding institution. country code", "",
				"Point of service entry mode", "PIN/PAN entry mode. Format PPN where PP=Pos entry mode and N=PIN entry mode.",
				"Application PAN number", "Identifies and differentiates cards with the same PAN",
				"Network International identifier", "",
				"Point of service condition code", "Condition under which the transaction takes place at POS. Various values.",
				"Point of service capture code", "Maximum number of PIN digits supported.",
				"Authorising identification response length", "",
				"Amount, transaction fee", "",
				"Amount. settlement fee", "",
				"Amount, transaction processing fee", "",
				"Amount, settlement processing fee", "",
				"Acquiring institution identification code", "Code identifying the acquirer",
				"Forwarding institution identofication code", "",
				"Primary account number, extended", "",
				"Track 2 data", "Information encoded on track 2 of the magstripe card",
				"Track 3 data", "",
				"Retrieval reference number", "Data for matching original txn Julian date+term sequence",
				"Authorisation identification response", "Authorisation ID assigned by authorising institution",
				"Response code", "Disposition of message: Approved, incorrect PIN etc etc)",
				"Service restriction code", "",
				"Card acceptor terminal identification", "Unique code identifying the terminal at the card acceptor location.",
				"Card acceptor identification code", "Code identifying the card acceptor.",
				"Card acceptor name/location", "Full terminal address (1-23 address 24-36 City 37-38 State 39-40 Country)",
				"Additional response data", "Used for POS referrals, format errors, or VISA acquired auth responses.",
				"Track 1 Data", "",
				"Additional data - ISO", "",
				"Additional data - National", "",
				"Additional data - Private", "",
				"Currency code, transaction", "Code (ISO?) of the local currency of the acquirer.",
				"Currency code, settlement", "",
				"Currency code, cardholder billing", "Code (ISO?) of the currency used for cardholder billing.",
				"Personal Identification number data", "Encrypted PIN block",
				"Security related control information", "",
				"Additional amounts", "Mandatory for txn response. Contains codes for account, amount and currency types and amounts.",
				"Reserved ISO", "",
				"Reserved ISO", "",
				"Reserved National", "",
				"Reserved National", "",
				"Reserved for national use", "",
				"Advice/reason code (private reserved)", "ICC reason for reveral or advice.",
				"Reserved Private", "",
				"Reserved Private", "",
				"Reserved Private", "",
				"Message authentication code (MAC)", "MAC check code",
				"Bit map, tertiary", "Tertiary bit map indicating the presence or absence of bits in positions 129-192 in the message being transmitted.",
				"Settlement code", "",
				"Extended payment code", "",
				"Receiving institution country code", "",
				"Settlement institution county code", "",
				"Network management Information code", "Network processing info. Various 3digit codes for sign on and off, keychange, cutover, handshake etc",
				"Message number", "",
				"Message number, last", "",
				"Date, Action", "",
				"Credits, number", "",
				"Credits, reversal number", "",
				"Debits, number", "",
				"Debits, reversal number", "",
				"Transfer number", "",
				"Transfer, reversal number", "",
				"Inquiries number", "",
				"Authorisations, number", "",
				"Credits, processsing fee amount", "",
				"Credits, transaction fee amount", "",
				"Debits, processing fee amount", "",
				"Debits, transaction fee amount", "",
				"Credits, amount", "",
				"Credits, reversal amount", "",
				"Debits, amount", "",
				"Debits, reversal amount", "",
				"Original data elements", "Data elements in a reversal identifying the original txn. These elements are formatted specifically.",
				"File update code", "Code indicating type of file update operation (1=add 2=change 3=delete 4=enquiry)",
				"File security code", "",
				"Response indicator", "",
				"Service indicator", "",
				"Replacement amounts", "Actual amounts dispensed and settled for partial reversals. If not partial both amounts are zero.",
				"Message security code", "Password to net management and file Update. Not currently validated by LINK",
				"Amount, net settlement", "",
				"Payee", "",
				"Settlement institution identification code", "",
				"Receiving institution identification code", "",
				"File name", "Name of file being accessed for a file update.",
				"Account identification 1", "Identifies the 'from' account in a transfer",
				"Account identification 2", "",
				"Transaction description", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for ISO use", "",
				"Reserved for national use", "",
				"Authorising agent institution id code", "Institution approving or denying the transaction.",
				"Reserved for national use", "",
				"Reserved for national use", "",
				"Reserved for national use", "",
				"Reserved for national use", "",
				"Reserved for national use", "",
				"Reserved for national use", "",
				"Reserved for private use", "",
				"Reserved for private use", "",
				"Reserved for private use", "",
				"Reserved for private use", "",
				"Info Text", "For file updates, cardholder file maint data, for admin advices the first 255 bytes in error.",
				"Network management information", "Additional net management info: 1-16 working key, 17-20 check value, 21-50 spaces",
				"Issuer trace id", "Used by issuer to label the txn with his own transaction id. Unique within business day. Unchanged through transaction life.",
				"Reserved for private use", "",
				"Message Authentication code", "MAC check code"
			};

}
